package com.xhdx.modules.boot.web.enums;

import com.xhdx.modules.boot.exception.IResponse;

/**
 * 全局公共异常返回值枚举类
 *
 * @author xujunqi
 * @date 2019/1/28 15:08
 */
public enum GlobalResponseEnum implements IResponse {
    /**
     * "成功", "0000"
     */
    SUCCESS("成功", "0000"),
    /**
     * "失败", "0001"
     */
    FAILURE("失败", "0001"),
    /**
     * "参数校验异常", "1101"
     */
    INVALID_PARAM("参数校验异常", "1101"),
    /**
     * "参数转换异常", "1102"
     */
    INVALID_PARAM_DATA_BIND("参数转换异常", "1102"),
    /**
     * "报表系统业务异常", "2000"
     */
    REPORT_ERROR("2000", "报表系统业务异常"),
    /**
     * "查询信息不存在", "2001"
     */
    QUERY_NOT_FOUND("2001", "查询信息不存在"),

    /**
     * "下载文件失败", "2001"
     */
    EXPORT_EXCEL_ERROR("2101", "下载文件失败"),
    /**
     * "系统处理异常", "9999"
     */
    ERROR("系统处理异常", "9999");
    private String message;
    private String code;

    GlobalResponseEnum(String message, String code) {
        this.message = message;
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getCode() {
        return code;
    }

}
